We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392573 - nasm 2.12.01 (from Debian 9) ignores %warning and %error within conditional blocks
Summary: nasm 2.12.01 (from Debian 9) ignores %warning and %error within conditional b...
Status: RESOLVED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.12.xx
Hardware: Other x86 Linux
: Medium critical
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2019-06-08 09:10 PDT by E. C. Masloch
Modified: 2019-06-09 04:48 PDT (History)
5 users (show)

Obtained from: From OS distribution
Generated by: ---
Bug category:
Observed for: ---
Regression: ---
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2019-06-08 09:10:38 PDT
$ nasm -v
NASM version 2.12.01
$ cat test.asm
%ifdef ONE
 %warning warning
        db 1
%endif
%ifdef TWO
 %error error
        db 2
%endif
%ifdef THREE
 %fatal fatal
        db 3
%endif
$ nasm test.asm -o test.bin -l test.lst
$ nasm test.asm -o test.bin -l test.lst -DONE
$ nasm test.asm -o test.bin -l test.lst -DTWO
$ nasm test.asm -o test.bin -l test.lst -DTHREE
test.asm:10: fatal: fatal
$ nasm test.asm -o test.bin -l test.lst -DONE -DTWO
$ nasm test.asm -o test.bin -l test.lst -DONE -DTHREE
test.asm:10: fatal: fatal
$ nasm test.asm -o test.bin -l test.lst -DTWO -DTHREE
test.asm:10: fatal: fatal
$ nasm test.asm -o test.bin -l test.lst -DONE -DTWO -DTHREE
test.asm:10: fatal: fatal
$ nasm test.asm -o test.bin -l test.lst -DONE -DTWO
$ cat test.lst
     1                                  %ifdef ONE
     2                                   %warning warning
     3 00000000 01                              db 1
     4                                  %endif
     5                                  %ifdef TWO
     6                                   %error error
     7 00000001 02                              db 2
     8                                  %endif
     9                                  %ifdef THREE
    10                                   %fatal fatal
    11                                          db 3
    12                                  %endif
$
Comment 1 E. C. Masloch 2019-06-09 02:49:47 PDT
Previously reported at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=875310 (I just experienced this again recently on a server running Debian 9.)
Comment 2 E. C. Masloch 2019-06-09 04:48:30 PDT
Documented for 2.12.02, so not a NASM problem anymore. Now if only Debian updated their package, oh well. Ckosing this bug.

https://nasm.us/doc/nasmdocc.html#section-C.1.8

> Version 2.12.02
>
> Fix preprocessor errors, especially %error and %warning, inside %if statements.